<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<script language="javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" src="js/jquery.checkboxes.min.js"></script>
<script language="javascript" src="js/tableRowCheckboxToggle.js"></script>
<script>
$(document).ready(function(){
		//点击事件切换 全选取消状态
		$("#selectall").click( function (){ $("#grouplist").toggleCheckboxes(); });
	});
</script>

<title>列表</title>
</head>

<body>
<div id="man_zone">
<?php if($action=="edit"){?>
<form action="?action=edit" method="post" enctype="multipart/form-data">
<table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <td width="15%" align="right" class="left_title_1">用户ID：</td>
      <td width="85%"><input name="aid" type="text" id="aid" value="<?php echo $value['aid']?>"  readonly="true"/></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">用户名：</td>
      <td><input name="user" type="text" id="user" value="<?php echo $value['user']?>" readonly="true"/></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">密码：</td>
      <td><input name="oldpassword" type="hidden" id="oldpassword" value="<?php echo $value['password']?>"  /><input name="password" type="text" id="password"  /></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">&nbsp;</td>
      <td><input type="submit" name="Submit" value="提交" />
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置" /></td>
    </tr>
  </table>

  </form>
   <?php }elseif($action=="add"){?>


<form action="?action=add" method="post" enctype="multipart/form-data">
<table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <td align="right" class="left_title_2">用户名：</td>
      <td><input name="user" type="text" id="user"/></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">密码：</td>
      <td><input name="password" type="text" id="password"  /></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">&nbsp;</td>
      <td><input type="submit" name="Submitadd" value="提交" />
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置" /></td>
    </tr>
  </table>

  </form>	
	
	
  <?php }elseif(empty($action)){?>
  
  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
    <tr>
      <td width="37%">
	    
    <input type="button" onclick="grouplist.submit();" name="Submit" value="删除选定" />
    <input type="button" onclick="location.href='?action=add'" name="Submit4" value="添加用户" /></td>
      <td width="63%" align="right"><form id="seach" name="seach" method="get" action="">
         &nbsp;用户名：
            <input name="user" type="text" id="user" size="15" />
          &nbsp;
            <input type="submit" name="Submit3" value="搜索" />
      </form>
      </td>
    </tr>
  </table>
<form method="post" action="?action=dels" name="grouplist" id="grouplist">
  <table width="99%" align="center"  border="0" cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <th width="2%"><label>
        <input type="checkbox" name="checkbox" value="checkbox" id="selectall" />
      </label></th>
      <th width="7%">管理员ID</th>
      <th width="13%">管理用户名</th>
      <th width="30%">最后登录时间</th>
      <th width="20%">登录次数</th>
      <th width="16%">状态</th>
      <th width="12%">操作</th>
    </tr>
	<?php if(is_array($dataarray)){foreach($dataarray as $value){?>
    <tr class="odd_row">
      <td align="center"><input type="checkbox" name="delids[]" value="<?php echo $value['aid']?>" /></td>
      <td><?php echo $value['aid']?></td>
      <td><?php echo $value['user']?></td>
      <td><?php if($value['lastlogin']!=0)echo date('Y-m-d H:i',$value['lastlogin'])?></td>
      <td><?php echo $value['logincount']?></td>
      <td><?php echo $value['state']?></td>
      <td>
<a href="sys_admin.php?action=edit&amp;aid=<?php echo $value['aid']?>">编辑用户 </a>|<a href="javascript:if(confirm('确实要删除吗?'))location='sys_admin.php?action=del&aid=<?php echo $value['aid']?>'"> 删除</a></td>
    </tr>
	<?php }}else{?>
	<tr><td colspan=7>暂无数据..............</td></tr>
	<?php };?>
  </table>
  

  <div style="width:99%;margin:0px auto;">

  
    <?php echo multi($total,$pagesize,$page,"");?>
  </div>
  </form>
  <?php }?>
</div>
</body>
</html>
